package com.example.perplonews.a_d_fragment.e_mine.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.perplonews.R
import com.example.perplonews.a_b_entity.UserItemEntity

class UserAdapter : BaseQuickAdapter<UserItemEntity, BaseViewHolder> {
    constructor(list: ArrayList<UserItemEntity>) : super(R.layout.user_item,list) {

    }

    override fun convert(helper: BaseViewHolder?, item: UserItemEntity?) {
        helper?.setText(R.id.user_itemes_tv, item?.name)
        helper?.setImageResource(R.id.user_itemes_arrow_img, R.mipmap.icon_pn_arrows)
        if (item?.name.equals("夜间模式")) {
            if (item?.flag!!) {
                helper?.setImageResource(R.id.user_itemes_arrow_img,R.mipmap.new_on)
            }else{
                helper?.setImageResource(R.id.user_itemes_arrow_img,R.mipmap.new_off)
            }
        }
        helper?.addOnClickListener(R.id.user_itemes_arrow_img)


    }

}